package com.qsw.paper.pojo.dto;

import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.hibernate.validator.constraints.URL;

import javax.validation.constraints.Pattern;

@Data
public class UserDto {
    private Integer userId;
    @NotEmpty
    @Pattern(regexp = "^(S\\d{8}|T\\d{8})$", message = "学号/工号格式不正确，学生以S开头，导师以T开头，后跟8位数字")
    private String username;
    @Email
    private String email;
    @NotBlank(message = "手机号不能为空")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确，必须是以1开头的11位数字")
    private String phone;
    @NotNull
    @NotEmpty
    @URL
    private String avatar;
}
